﻿using System;
using System.ComponentModel;

namespace DataConvertLib
{
	/// <summary>
	/// 操作结果类
	/// </summary>
	// Token: 0x0200000E RID: 14
	[Description("操作结果类")]
	public class OperateResult
	{
		/// <summary>
		/// 结果是否成功
		/// </summary>
		// Token: 0x17000004 RID: 4
		// (get) Token: 0x06000068 RID: 104 RVA: 0x00004A80 File Offset: 0x00002C80
		// (set) Token: 0x06000069 RID: 105 RVA: 0x00004A88 File Offset: 0x00002C88
		public bool IsSuccess { get; set; }

		/// <summary>
		/// 错误描述
		/// </summary>
		// Token: 0x17000005 RID: 5
		// (get) Token: 0x0600006A RID: 106 RVA: 0x00004A91 File Offset: 0x00002C91
		// (set) Token: 0x0600006B RID: 107 RVA: 0x00004A99 File Offset: 0x00002C99
		public string Message { get; set; } = "UnKnownError";

		/// <summary>
		/// 错误代码
		/// </summary>
		// Token: 0x17000006 RID: 6
		// (get) Token: 0x0600006C RID: 108 RVA: 0x00004AA2 File Offset: 0x00002CA2
		// (set) Token: 0x0600006D RID: 109 RVA: 0x00004AAA File Offset: 0x00002CAA
		public int ErrorCode { get; set; } = 99999;

		/// <summary>
		/// 构造方法
		/// </summary>
		// Token: 0x0600006E RID: 110 RVA: 0x00004AB3 File Offset: 0x00002CB3
		public OperateResult()
		{
		}

		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="isSuccess">操作是否成功</param>
		// Token: 0x0600006F RID: 111 RVA: 0x00004AD3 File Offset: 0x00002CD3
		public OperateResult(bool isSuccess)
		{
			this.IsSuccess = isSuccess;
		}

		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="isSuccess">操作是否成功</param>
		/// <param name="message">结果信息</param>
		// Token: 0x06000070 RID: 112 RVA: 0x00004AFB File Offset: 0x00002CFB
		public OperateResult(bool isSuccess, string message)
		{
			this.IsSuccess = isSuccess;
			this.Message = message;
		}

		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="isSuccess">操作是否成功</param>
		/// <param name="errorCode">错误代码</param>
		/// <param name="message">结果信息</param>
		// Token: 0x06000071 RID: 113 RVA: 0x00004B2B File Offset: 0x00002D2B
		public OperateResult(bool isSuccess, int errorCode, string message)
		{
			this.IsSuccess = isSuccess;
			this.ErrorCode = errorCode;
			this.Message = message;
		}

		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="message">结果信息</param>
		// Token: 0x06000072 RID: 114 RVA: 0x00004B63 File Offset: 0x00002D63
		public OperateResult(string message)
		{
			this.Message = message;
		}

		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="errorCode">错误代码</param>
		/// <param name="message">结果信息</param>
		// Token: 0x06000073 RID: 115 RVA: 0x00004B8B File Offset: 0x00002D8B
		public OperateResult(int errorCode, string message)
		{
			this.ErrorCode = errorCode;
			this.Message = message;
		}

		/// <summary>
		/// 创建一个操作成功结果
		/// </summary>
		/// <returns></returns>
		// Token: 0x06000074 RID: 116 RVA: 0x00004BBC File Offset: 0x00002DBC
		public static OperateResult CreateSuccessResult()
		{
			return new OperateResult
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success"
			};
		}

		/// <summary>
		/// 创建一个操作失败结果，带结果信息
		/// </summary>
		/// <param name="message"></param>
		/// <returns></returns>
		// Token: 0x06000075 RID: 117 RVA: 0x00004BF0 File Offset: 0x00002DF0
		public static OperateResult CreateFailResult(string message)
		{
			return new OperateResult
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}

		/// <summary>
		/// 创建一个操作失败结果，不带结果信息
		/// </summary>
		/// <returns></returns>
		// Token: 0x06000076 RID: 118 RVA: 0x00004C24 File Offset: 0x00002E24
		public static OperateResult CreateFailResult()
		{
			return new OperateResult
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = "UnKnownError"
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T">类型</typeparam>
		/// <param name="value">值</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000077 RID: 119 RVA: 0x00004C5C File Offset: 0x00002E5C
		public static OperateResult<T> CreateSuccessResult<T>(T value)
		{
			return new OperateResult<T>
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success",
				Content = value
			};
		}

		/// <summary>
		/// 创建带一个数据的操作失败结果
		/// </summary>
		/// <typeparam name="T">类型</typeparam>
		/// <param name="result">操作结果对象</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000078 RID: 120 RVA: 0x00004C98 File Offset: 0x00002E98
		public static OperateResult<T> CreateFailResult<T>(OperateResult result)
		{
			return new OperateResult<T>
			{
				IsSuccess = false,
				ErrorCode = result.ErrorCode,
				Message = result.Message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作失败结果
		/// </summary>
		/// <typeparam name="T">类型</typeparam>
		/// <param name="message">错误信息</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000079 RID: 121 RVA: 0x00004CD4 File Offset: 0x00002ED4
		public static OperateResult<T> CreateFailResult<T>(string message)
		{
			return new OperateResult<T>
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <param name="value1">值1</param>
		/// <param name="value2">值2</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007A RID: 122 RVA: 0x00004D08 File Offset: 0x00002F08
		public static OperateResult<T1, T2> CreateSuccessResult<T1, T2>(T1 value1, T2 value2)
		{
			return new OperateResult<T1, T2>
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success",
				Content1 = value1,
				Content2 = value2
			};
		}

		/// <summary>
		/// 创建带一个数据的操作失败结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <param name="result">操作结果</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007B RID: 123 RVA: 0x00004D4C File Offset: 0x00002F4C
		public static OperateResult<T1, T2> CreateFailResult<T1, T2>(OperateResult result)
		{
			return new OperateResult<T1, T2>
			{
				IsSuccess = false,
				ErrorCode = result.ErrorCode,
				Message = result.Message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作失败结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <param name="message">错误信息</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007C RID: 124 RVA: 0x00004D88 File Offset: 0x00002F88
		public static OperateResult<T1, T2> CreateFailResult<T1, T2>(string message)
		{
			return new OperateResult<T1, T2>
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <param name="value1">值1</param>
		/// <param name="value2">值2</param>
		/// <param name="value3">值3</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007D RID: 125 RVA: 0x00004DBC File Offset: 0x00002FBC
		public static OperateResult<T1, T2, T3> CreateSuccessResult<T1, T2, T3>(T1 value1, T2 value2, T3 value3)
		{
			return new OperateResult<T1, T2, T3>
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success",
				Content1 = value1,
				Content2 = value2,
				Content3 = value3
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <param name="result">操作结果</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007E RID: 126 RVA: 0x00004E08 File Offset: 0x00003008
		public static OperateResult<T1, T2, T3> CreateFailResult<T1, T2, T3>(OperateResult result)
		{
			return new OperateResult<T1, T2, T3>
			{
				IsSuccess = false,
				ErrorCode = result.ErrorCode,
				Message = result.Message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <param name="message">错误信息</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x0600007F RID: 127 RVA: 0x00004E44 File Offset: 0x00003044
		public static OperateResult<T1, T2, T3> CreateFailResult<T1, T2, T3>(string message)
		{
			return new OperateResult<T1, T2, T3>
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <param name="value1">值1</param>
		/// <param name="value2">值2</param>
		/// <param name="value3">值3</param>
		/// <param name="value4">值4</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000080 RID: 128 RVA: 0x00004E78 File Offset: 0x00003078
		public static OperateResult<T1, T2, T3, T4> CreateSuccessResult<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4)
		{
			return new OperateResult<T1, T2, T3, T4>
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success",
				Content1 = value1,
				Content2 = value2,
				Content3 = value3,
				Content4 = value4
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <param name="result">操作结果</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000081 RID: 129 RVA: 0x00004ECC File Offset: 0x000030CC
		public static OperateResult<T1, T2, T3, T4> CreateFailResult<T1, T2, T3, T4>(OperateResult result)
		{
			return new OperateResult<T1, T2, T3, T4>
			{
				IsSuccess = false,
				ErrorCode = result.ErrorCode,
				Message = result.Message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <param name="message">错误信息</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000082 RID: 130 RVA: 0x00004F08 File Offset: 0x00003108
		public static OperateResult<T1, T2, T3, T4> CreateFailResult<T1, T2, T3, T4>(string message)
		{
			return new OperateResult<T1, T2, T3, T4>
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <typeparam name="T5">类型5</typeparam>
		/// <param name="value1">值1</param>
		/// <param name="value2">值2</param>
		/// <param name="value3">值3</param>
		/// <param name="value4">值4</param>
		/// <param name="value5">值5</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000083 RID: 131 RVA: 0x00004F3C File Offset: 0x0000313C
		public static OperateResult<T1, T2, T3, T4, T5> CreateSuccessResult<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)
		{
			return new OperateResult<T1, T2, T3, T4, T5>
			{
				IsSuccess = true,
				ErrorCode = 0,
				Message = "Success",
				Content1 = value1,
				Content2 = value2,
				Content3 = value3,
				Content4 = value4,
				Content5 = value5
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <typeparam name="T5">类型5</typeparam>
		/// <param name="result">操作结果</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000084 RID: 132 RVA: 0x00004F98 File Offset: 0x00003198
		public static OperateResult<T1, T2, T3, T4, T5> CreateFailResult<T1, T2, T3, T4, T5>(OperateResult result)
		{
			return new OperateResult<T1, T2, T3, T4, T5>
			{
				IsSuccess = false,
				ErrorCode = result.ErrorCode,
				Message = result.Message
			};
		}

		/// <summary>
		/// 创建带一个数据的操作成功结果
		/// </summary>
		/// <typeparam name="T1">类型1</typeparam>
		/// <typeparam name="T2">类型2</typeparam>
		/// <typeparam name="T3">类型3</typeparam>
		/// <typeparam name="T4">类型4</typeparam>
		/// <typeparam name="T5">类型5</typeparam>
		/// <param name="message">错误信息</param>
		/// <returns>带一个数据的操作结果</returns>
		// Token: 0x06000085 RID: 133 RVA: 0x00004FD4 File Offset: 0x000031D4
		public static OperateResult<T1, T2, T3, T4, T5> CreateFailResult<T1, T2, T3, T4, T5>(string message)
		{
			return new OperateResult<T1, T2, T3, T4, T5>
			{
				IsSuccess = false,
				ErrorCode = 99999,
				Message = message
			};
		}
	}
}
